import $http from "@/ajax/http.js";

export const phone = {
	data(){
		return{
			linkPhone:''
		}
	},
	methods:{
		// 调用手机拨号
		getPhone() {
			const that = this
			uni.showModal({
				title: '提示',
				content: '是否拨打电话？',
				success: function(res) {
					if (res.confirm) {
						uni.makePhoneCall({
							phoneNumber: that.linkPhone,
							success: function() {
								console.log('拨打电话成功');
							},
							fail: function(error) {
								console.log('拨打电话失败：' + JSON.stringify(error));
							}
						});
					} else if (res.cancel) {
						console.log('用户取消拨打电话');
					}
				}
			});
		}
	}
}